In many computer systems, especially those of a multiprocessor architecture, it is important to determine how much time the operating system spends in various portions of the software code. This is especially true where there is contention for physical resources, such as communications bandwidth and memory, and where there is contention for objects such as code, data, and control. The ability to segmentize the software code and to determine for how long and the number of times each segment is utilized are important factors in designing multiprocessor architecture and software support.
Prior art techniques for obtaining this software utilization information include stochastic measurements derived from profiling methods. One profile method is to check the computer's program counter every 16.7 ms (i.e., once every cycle at the 60 Hz power line frequency) to indicate which portion of the computer software is running at that instant. The results of this program counter check can be assembled to develop a profile of timing information for the program segments. Hardware logic analyzers can also be used to check the logic state of control lines or buses within the computer to determine the currently-running statements or segments of the program. Some computer systems also provide a visual indication when certain peripheral devices are accessed by the central-processing unit. Although these prior art techniques provide limited information concerning the operating time of a software program, they do not provide the substantial amount of deterministic information that can be gained using the present invention, and that is necessary to refine the software code to decrease run-time and avoid access contention problems in parallel architectures.